package business.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Required;
import org.springframework.transaction.annotation.Transactional;

import vo.PK;
import business.PKService;
import dao.PKDAO;

public class PKServiceImpl implements PKService {

	private PKDAO PKDao;

	public List<PK> getAllPKs() {
		return PKDao.findAll();
	}

	@Required
	public void setPKDao(PKDAO PKDao) {
		this.PKDao = PKDao;
	}

	@Transactional
	public void addPK(String name) {
		PK e = new PK();
		e.setName(name);
		PKDao.create(e);
	}

	@Transactional
	public void addPK(PK pk) {
		PKDao.create(pk);
	}

}